I ran into this - or something very much like it - and wrote about it at https://wadetregaskis.com/getbitmapdataplanes-can-break-nsimages-nsbitmapimagereps/. It seems to be a bug in NSBitmapImageRep that's triggered when you (or library code) calls bitmapData or getBitmapDataPlanes. You can maybe work around it by calling recache on the NSImage, if you don't actually need access to the bitmap's bytes.